Conditions | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | const { Module } = require('module'); |
||
10 | function isPathInside(childPath, parentPath) { |
||
11 | const relation = path.relative(parentPath, childPath); |
||
12 | |||
13 | return Boolean( |
||
14 | relation && |
||
15 | relation !== '..' && |
||
16 | !relation.startsWith(`..${path.sep}`) && |
||
17 | relation !== path.resolve(childPath) |
||
18 | ); |
||
19 | } |
||
20 | |||
38 |